#ifndef CTTEST_H
#define CTTEST_H

#include <QWidget>
#include <QtGui>
#include <myButton.h>
#include <dialog.h>
class CtTest : public QWidget
{
    Q_OBJECT
public:
    explicit CtTest(QWidget *parent = 0);
    QByteArray sendBuf;
signals:
    


protected:
     bool eventFilter(QObject *obj, QEvent *event);
private:
    Dialog *theKeyBoard;
    QTabWidget *tabWidget;
    QListWidget *toplist;
    QStackedWidget *stack;


//******CT 测试******************************************************//
    QLabel *wcTest;

    QRadioButton *btnStart;//单选框 手动
    QLabel *inputBH; //输入编号
    QLabel *inputXH; //输入型号
    QLabel *edFH;    //额定负荷
    QLabel *xxFH;    //下限负荷
    QLabel *current1;//一次电流
    QLabel *current2;//二次电流
    QLabel *inputJD; //输入精度
    QLabel *glYS;    //功率因素
    QLabel *danweiVA1;
    QLabel *danweiVA2;
    QLabel *danweiA1;
    QLabel *danweiA2;
    QLineEdit *BHEdit;
    QLineEdit *XHEdit;
    QLineEdit *edEdit;
    QLineEdit *xxEdit;
    QLineEdit *IEdit1;
    QLineEdit *IEdit2;
    QLineEdit *JDEdit;
    QLineEdit *YSEdit;
    QComboBox *JDcom;
    QPushButton *Manuals;//手动设置
    QPushButton *Startest;//开始设置
    QComboBox *user_defined;//用户自定义的
    QPushButton *setting;//自设定点设置

//************自动——手动测试显示界面****************************//
    QWidget *addwidget1; //手动显示
    void areaParameter(QGroupBox *parameter);
    void areaDialgage(QGroupBox *dialgage);
    void areatest_result(QGroupBox *result);
    QLineEdit *bbEdit;
    QLineEdit *fhEdit;
    QLineEdit *glEdit;
    QPushButton *close;
    QLineEdit *bfbEdit; //百分表编辑框
    QPushButton *bfbBtn1;//百分表上调
    QPushButton *bfbBtn2;//百分表下调
    QPushButton *bfbset0;//回零
    QPushButton *changeBtn;//粗细调节
    QLineEdit *bcEdit;
    QLineEdit *jcEdit;

//*******************************************************************//
    QWidget *addwidget2; //自动显示
    QLabel *bhLabel;
    QLabel *xhLabel;
    QLabel *edLabel;
    QLabel *edLabelx;
    QLabel *csdLabel1;
    QLabel *bfb5;
    QLabel *bfb20;
    QLabel *bfb100;
    QLabel *bfb120;
    QLabel *xxLabel;
    QLabel *xxLabelx;

    QLabel *bbshow;
    QLabel *glshow;
    QLabel *wendu;
    QLabel *shidu;
    QLineEdit *edwcEdit;
    QLineEdit *xxwcEdit;
    QLineEdit *bbshowEdit;
    QLineEdit *glshowEdit;
    QLineEdit *wenduEdit;
    QLineEdit *shiduEdit;



    QLabel *dateshow; //时间显示
    QTimer *datetimer;//时间的定时器
    QTableWidget *table;//表格
    QTableWidget *table2;

    void setDataStyle(QLabel *lab);
    QLabel *labSumOfRecords;

    QLabel *labSN;
    QLabel *labPN;
    QLabel *labDate;

    QLabel *labRatio;
    QLabel *labPrecise;
    QLabel *labPowerFactor;

    QLabel *labNormalLoadValue;
    QLabel *labMiniLoadValue;

    QLabel *labErrorNormal20Ratio;
    QLabel *labErrorNormal50Ratio;
    QLabel *labErrorNormal80Ratio;
    QLabel *labErrorNormal100Ratio;
    QLabel *labErrorNormal120Ratio;
    QLabel *labErrorMini80Ratio;
    QLabel *labErrorMini100Ratio;
    QLabel *labErrorMini120Ratio;
    QLabel *labErrotMiniK1Ratio;
    QLabel *labErrotMiniK2Ratio;

    QLabel *labErrorNormal20Phase;
    QLabel *labErrorNormal50Phase;
    QLabel *labErrorNormal80Phase;
    QLabel *labErrorNormal100Phase;
    QLabel *labErrorNormal120Phase;
    QLabel *labErrorMini80Phase;
    QLabel *labErrorMini100Phase;
    QLabel *labErrorMini120Phase;
    QLabel *labErrotMiniK1Phase;
    QLabel *labErrotMiniK2Phase;
    //QPushButton *btnPre;
    //QPushButton *btnNxt;
    QWidget *tableShowData;//图片加载
    QLabel *bcdw;
    QLabel *jcdw;
    QLabel *bctest;
    QLabel *jctest;
    void zi_dong_setting();
    void shou_dong_setting();
 //****************误差测试点设定*******************************//

    QLabel *wcTestpoint;
    QLabel *edTest1;
    QLabel *edTest2;
    QLabel *edTest3;
    QLabel *edTest4;
    QLabel *edTest5;
    QLabel *edTest6;

    QLabel *xxTest1;
    QLabel *xxTest2;
    QLabel *xxTest3;
    QLabel *xxTest4;


    QLabel *danwei1;//单位
    QLabel *danwei2;
    QLabel *danwei3;
    QLabel *danwei4;
    QLabel *danwei5;
    QLabel *danwei6;
    QLabel *danwei7;
    QLabel *danwei8;
    QLabel *danwei9;
    QLabel *danwei10;

    QLineEdit *testEdit1;//误差测试点的文本编辑框 从上倒下
    QLineEdit *testEdit2;
    QLineEdit *testEdit3;
    QLineEdit *testEdit4;
    QLineEdit *testEdit5;
    QLineEdit *testEdit6;
    QLineEdit *testEdit7;
    QLineEdit *testEdit8;
    QLineEdit *testEdit9;
    QLineEdit *testEdit10;

    QRadioButton *testRadio1;
    QRadioButton *testRadio2;

    QButtonGroup *grop1;//单选框组
    QButtonGroup *grop2;
    QWidget *widgetTest;
public slots:
    void recvResult(QByteArray rcvdByte);

    void Manuals_Automatic_page_page();
    void close_page();//页面关闭
    void qtimeSlot();//日期刷新
    void test_radio_chilck();//误差测试点设置

    void bfb_UP();//+
    void bfb_DOWN();//-
    void bfb_SET0();//零调
    void bfb_CHANGE();//粗细转换

    void setting_Value(QString str);//判断是否自设
    void show_Widget(){widgetTest->show();addwidget1->hide();addwidget2->hide();}
    void hide_widget(){widgetTest->hide();}
};

#endif // CTTEST_H
